# Turn on the rewrite engine
RewriteEngine On

# Allow access to existing directories and files (like images, css, js)
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f

# Route all other requests to index.php, passing the requested path as the 'url' parameter
RewriteRule ^(.*)$ index.php?url=$1 [QSA,L]

# Prevent directory listing for security
Options -Indexes

# Deny access to the config file once it's created
<Files "config.php">
    Order Allow,Deny
    Deny from all
</Files>